Skip to content

fix: paginate PR file fetch for scoring accuracy#274

Open
taooutsider wants to merge 11 commits intoentrius:testfrom
taooutsider:codex/sn74-pr-files-pagination
Open

fix: paginate PR file fetch for scoring accuracy#274
taooutsider wants to merge 11 commits intoentrius:testfrom
taooutsider:codex/sn74-pr-files-pagination

Conversation

@taooutsider
Copy link

Summary

  • paginate GET /repos/{owner}/{repo}/pulls/{number}/files using per_page=100 + page
  • aggregate all changed files before scoring
  • preserve existing retry/backoff behavior on transient failures

Why

GitHub returns only 30 files by default for PR file listings. For PRs with many changed files, scoring could miss file diffs and undercount contribution value.

Changes

  • update get_pull_request_file_changes() to fetch all pages
  • add tests for:
    • multi-page aggregation
    • retry when page 2 fails, restarting from page 1

Validation

  • pytest -q tests/utils/test_github_api_tools.py -k FileChangesRetryLogic
  • result: 10 passed

bittoby and others added 11 commits March 2, 2026 15:14
…ntrius#238)

Co-authored-by: bittoby <bittoby@users.noreply.github.com>
Co-authored-by: Ander <61125407+anderdc@users.noreply.github.com>
…a_web_agents_subnet (entrius#251)

Co-authored-by: Nicknamess96 <113626193+Nicknamess96@users.noreply.github.com>
Co-authored-by: Ander <61125407+anderdc@users.noreply.github.com>
Co-authored-by: BitToby <218712309+bittoby@users.noreply.github.com>
Co-authored-by: bittoby <bittoby@users.noreply.github.com>
Co-authored-by: Muhammet Eren Karakuş <erenkar950@gmail.com>
…epo (entrius#256)

Co-authored-by: Ander <61125407+anderdc@users.noreply.github.com>
Co-authored-by: Ander <61125407+anderdc@users.noreply.github.com>
Co-authored-by: anderdc <alexanderdcastaneda@gmail.com>
Co-authored-by: Ander <61125407+anderdc@users.noreply.github.com>
Co-authored-by: Ander <61125407+anderdc@users.noreply.github.com>
@taooutsider
Copy link
Author

This fix prevents truncated PR file lists when changed files > 30 (GitHub default), which can under-score larger contributions. Happy to adjust if you prefer Link-header based pagination.

@anderdc
Copy link
Collaborator

anderdc commented Mar 12, 2026

please fix conflicts, will not review until then

@anderdc anderdc force-pushed the test branch 3 times, most recently from bcd7b1f to 4e74e2a Compare March 16, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants